<template>
	<view style="height: 100%;">
		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :vertical="false"
			:circular="true" style="height: 150px;" @change="swiperChange">
			<swiper-item v-for="item,index in list">
				<view class="swiper-item" style="width: 100%;height: 100%;">
					<image :src="item" mode="" style="width: 100%;height: 100%;"></image>
				</view>
			</swiper-item>
		</swiper>
	
		<uni-section title="功能列表" sub-title="" type="square">
				</uni-section>
				<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" class="com">
					<swiper-item>
						<view class="contents">
							<uni-list>
								<uni-list-item v-for="(item, index) in content"
									:title="item.contents"></uni-list-item>
							</uni-list>
						</view>
					</swiper-item>
		<swiper-item>
		<uni-grid :column="5" @change="gridChange">
			<uni-grid-item :index="index" v-for="(item,index) in typelist">
				<view class="grid-item">
					<image :src="'/static'+item.icon" mode="" style="width: 45px;height: 45px;"></image>
					<text>{{item.typename}}</text>
				</view>
			</uni-grid-item>
		</uni-grid>
		</swiper-item>
		</swiper>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					'../../static/image/one.png',
					'../../static/image/two.png',
					'../../static/image/three.png',
					'../../static/image/four.png'
				],
				"typelist": [{
						"id": 1,
						"icon": "/image/news.png",
						"typename": "新闻"
					},
					{
						"id": 2,
						"icon": "/image/announcement.png",
						"typename": "公告"
					},
					{
						"id": 3,
						"icon": "/image/classmate.png",
						"typename": "同学"
					},
					{
						"id": 4,
						"icon": "/image/telephone.png",
						"typename": "电话"
					},
					{
						"id": 5,
						"icon": "/image/leaveword.png",
						"typename": "留言"
					},
				],
				content: [{
						"contents": "食堂1",
					},
					{
						"contents": "食堂2",
					},
					{
						"contents": "食堂3",
					}
				],
			}
		},
		onLoad() {

		},
		methods: {
			swiperChange(e) {
				console.log("===", e);
			},
			gridChange(e) {
				console.log("----", e)
			},

		}
	}
</script>

<style>
	page {
		height: 100%;
	}

	.grid-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-around;
	}
</style>